package com.xr.blackhoole.autoconfigurer;

import com.xr.blackhoole.autoconfigurer.datasource.BlackholeDataSourceAutoConfiguration;
import com.xr.blackhoole.autoconfigurer.datasource.mybatis.BlackholeMybatisConfiguration;
import com.xr.blackhoole.autoconfigurer.feign.BlackholeFeginAutoConfiguration;
import com.xr.blackhoole.autoconfigurer.hystrix.BlackholeHystrixAutoConfiguration;
import com.xr.blackhoole.autoconfigurer.mock.WormholeMockAutoConfiguration;
import com.xr.blackhoole.autoconfigurer.mvc.BlackholeMVCAutoConfiguration;
import com.xr.blackhoole.autoconfigurer.rabbit.BlackholeRabbitAutoConfiguration;
import com.xr.blackhoole.autoconfigurer.redis.BlackholeRedisAutoConfiguration;
import com.xr.blackhoole.mvc.configuration.BlackholeIsolationConfiguration;
import com.xr.blackhoole.mvc.configuration.BlackholePropertiesConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

@Configuration
@Import({BlackholeRedisAutoConfiguration.class,
        BlackholeRabbitAutoConfiguration.class,
        BlackholeMVCAutoConfiguration.class,
        BlackholeHystrixAutoConfiguration.class,
        BlackholeFeginAutoConfiguration.class,
        BlackholeDataSourceAutoConfiguration.class,
        BlackholeMybatisConfiguration.class,
        WormholeMockAutoConfiguration.class})
public class BlackholeAutoConfiguration {
    
    @Bean
    @ConditionalOnClass
    public BlackholePropertiesConfiguration blackholePropertiesConfiguration() {
        return new BlackholePropertiesConfiguration();
    }

    @Bean
    @ConditionalOnClass
    public BlackholeIsolationConfiguration blackholeIsolationConfiguration() {
        return new BlackholeIsolationConfiguration();
    }

}
